//
// Double-Ended Queue
// Created by Win10 on 2022/10/31.
//

#ifndef C_DATA_STRUCTURE_DE_QUEUE_H
#define C_DATA_STRUCTURE_DE_QUEUE_H

#define MaxSize 5

typedef int ElemType;

typedef struct {
    int front, rear;
    int size;
    ElemType data[MaxSize];
} DeQue;

void InitQueue(DeQue &Q);

bool QueueEmpty(DeQue Q);

bool QueueFull(DeQue Q);

bool EnQueue_Head(DeQue &Q, ElemType x);

bool EnQueue_Rear(DeQue &Q, ElemType x);

bool DeQueue_Head(DeQue &Q, ElemType &x);

bool DeQueue_Rear(DeQue &Q, ElemType &x);

bool GetHead(DeQue Q, ElemType &x);

int GetSize(DeQue Q);  //返回队列元素的个数

#endif //C_DATA_STRUCTURE_DE_QUEUE_H
